package com.onlyxiahui.framework.json.validator;

/**
 * 
 * Date 2018-12-26 10:38:55<br>
 * Description 校验接口
 * 
 * @author XiaHui<br>
 * @param <D>
 * @param <A>
 * @since 1.0.0
 */
public interface Validator<D, A> {

	/**
	 * 
	 * Date 2018-12-26 15:35:12<br>
	 * Description 进行验证
	 * 
	 * @param data      ：数据主体<br>
	 * @param attribute ：验证的对象
	 * @param judge     ：用于判断的验证对象是否合法的值
	 * @param code
	 * @param message
	 * @return String
	 * @since 1.0.0
	 */
	public ValidatorResult valid(D data, A attribute, Object judge, String code, String message);

	/**
	 * 
	 * Date 2018-12-26 15:34:52<br>
	 * Description 获取验证器的key
	 * 
	 * @return String
	 * @since 1.0.0
	 */
	public String getKey();

}
